package com.sixnimmt.app.client.game.dto;

import java.io.Serializable;

public class PlayerScore implements Comparable<PlayerScore>, Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private final String playerName;
	private final int score;
	private int rank;

	public PlayerScore(String playerName, Integer score) {
		super();
		this.playerName = playerName;
		this.score = score;
	}

	public String getPlayerName() {
		return playerName;
	}

	public Integer getScore() {
		return score;
	}

	public int getRank() {
		return rank;
	}

	public void setRank(int rank) {
		this.rank = rank;
	}

	@Override
	public int compareTo(PlayerScore other) {
		return (this.score - other.score);
	}

	@Override
	public String toString() {
		return rank + ". " + playerName + " " + score;
	}

}
